package com.qf.config;


import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author：刘亚康
 * @Date：2020/4/7
 * @QQ：50770284
 * @Phone：18235947935
 * @Desc : RabbitMQ配置类
 **/
@Configuration
public class RabbitMQConfig {
    @Bean
    public Queue emailQueue(){
        return new Queue("emailQueue");
    }
    @Bean
    public FanoutExchange emailExchange(){
        return new FanoutExchange("emailExchange");
    }
    @Bean
    public Binding binding(){
        return BindingBuilder.bind(emailQueue()).to(emailExchange());
    }
}
